package com.huawei.service.impl;

import java.util.List;

import com.huawei.dao.UserDao;
import com.huawei.pagination.QueryResult;
import com.huawei.service.UserService;
import com.huawei.vo.UserVo;

public class UserServiceImpl implements UserService {

	private UserDao userDao;

	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

	public UserVo checkUser(UserVo userVo) throws Exception {
		return this.userDao.checkUser(userVo);
	}

	public void addUser(UserVo uservo) throws Exception {
		this.userDao.addUser(uservo);

	}

	public void delUser(Integer userId) throws Exception {
		this.userDao.delUser(userId);
	}

	public void editUser(UserVo uservo) throws Exception {
		this.userDao.editUser(uservo);
	}

	public UserVo getUserById(Integer userId) throws Exception {
		return this.userDao.getUserById(userId);
	}

	public Integer userRepeat(UserVo uservo) throws Exception {
		return this.userDao.userRepeat(uservo);
	}

	public QueryResult<UserVo> getUserList(UserVo uservo) throws Exception {
		QueryResult<UserVo> queryResult = new QueryResult<UserVo>();
		List<UserVo> userList = this.userDao.getUserList(uservo);
		Integer userCount = this.userDao.getUserCount(uservo);
		queryResult.setResutllist(userList);
		queryResult.setTotalrecord(userCount);
		return queryResult;
	}
}
